import 'package:flutter_test/flutter_test.dart';
import 'package:xb_plugin/xb_plugin.dart';
import 'package:xb_plugin/xb_plugin_platform_interface.dart';
import 'package:xb_plugin/xb_plugin_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockXbPluginPlatform
    with MockPlatformInterfaceMixin
    implements XbPluginPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');
}

void main() {
  final XbPluginPlatform initialPlatform = XbPluginPlatform.instance;

  test('$MethodChannelXbPlugin is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelXbPlugin>());
  });

  test('getPlatformVersion', () async {
    XbPlugin xbPlugin = XbPlugin();
    MockXbPluginPlatform fakePlatform = MockXbPluginPlatform();
    XbPluginPlatform.instance = fakePlatform;

    expect(await xbPlugin.getPlatformVersion(), '42');
  });
}
